package com.linran.domain;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.annotation.*;
import com.linran.constant.Sex;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@TableName(value = "user", resultMap = "BaseResultMap")
//@TableName(value = "user", autoResultMap = true)
public class User {
    /**
     * 主键自增
     * 数据库也要相应设置主键自增
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String name;
    private Integer age;
    private String email;
    @JSONField(serialzeFeatures= SerializerFeature.WriteEnumUsingToString)
    private Sex sex;

    /** 移动电话 */
    @TableField(value = "mobile_phone")
    private String mobilePhone;

    @TableField(exist = false)
    private String transientFiled;
}
